<?php
/**
 * @CopyRight  (C)2006-2011 OE Development team Inc.
 * @WebSite    www.phpcoo.com，www.oecms.cn
 * @Author     XiangFeng <phpzac@foxmail.com>
 * @Brief      OEcms v3.x
 * @Update     2011.09.01
 **/
if(!defined('IN_PHPOE')) {
    exit('Access Denied');
}
$config = array();
$config_sql = "SELECT * FROM " . DB_PREFIX . "config LIMIT 1";
$config = $db->fetch_first($config_sql);
if(!$config) {
    echo "Config Error！";
    die();
}
$tplext = "tpl";
$core_skin_sql = "SELECT skinid,skindir,skinext FROM " . DB_PREFIX . "skin WHERE flag=1 ORDER BY orders ASC LIMIT 1";
$core_skin = $db->fetch_first($core_skin_sql);
if($core_skin) {
    $index_tempdir = "tpl/" . $core_skin['skindir'] . "/";
    $tplext = $core_skin['skinext'];
    define('INDEX_TEMPLATE', $index_tempdir);
} else {
    define('INDEX_TEMPLATE', DEFAULT_TEMPLATE);
}
$urlsuffix = "php";
if($config['htmltype'] == "html" || $config['htmltype'] == "rewrite") {
    $urlsuffix = "html";
}
$tpl->assign("config", $config);
$tpl->assign("urlsuffix", $urlsuffix);
$tpl->assign("tplext", $tplext);
$tpl->assign("urltype", $config['htmltype']);
$tpl->assign("skinpath", INDEX_TEMPLATE);
$tpl->assign("urlpath", PATH_URL);
$tpl->assign("tplpath", INDEX_TEMPLATE);
$tpl->assign("copyright_header", "Powered By PHPCoo.Com");
$tpl->assign("copyright_author", "" . OECMS_VERSION . "-Powered By phpcoo.com");
$tpl->assign("copyright_poweredby", "Powered by <a href='" . OECMS_URL . "' target='_blank'>" . OECMS_VERSION . "</a>");
$tpl->assign("copyright_version", OECMS_VERSION);
$tpl->assign("copyright_release", OECMS_RELEASE);
$tpl->assign("page_charset", PHPOE_CHARSET);
$tpl->assign("foretplpath", INDEX_TEMPLATE);
$tpl->assign("admintplpath", ADMIN_TEMPLATE);